package com.mdlib.droid.module.user.fragment;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.mdlib.droid.R;
import com.mdlib.droid.base.BaseTitleFragment;
import com.mdlib.droid.model.entity.BuyRecordEntity;
import com.mdlib.droid.module.user.adapter.BuyRecordAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 作者：HQY on 2018/11/5 14:10
 * 邮箱：hqy_xz@126.com
 */

public class BuyRecordFragment extends BaseTitleFragment {


    @BindView(R.id.rv_buy_record)
    RecyclerView mRvBuyRecord;
    private List<BuyRecordEntity> mRecordList = new ArrayList<>();
    private BuyRecordAdapter mRecordAdater;

    public static BuyRecordFragment newInstance() {
        Bundle args = new Bundle();
        BuyRecordFragment fragment = new BuyRecordFragment();
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    protected int getContentLayoutId() {
        return R.layout.fragment_buy_record;
    }

    @Override
    protected void initView(View rootView) {
        super.initView(rootView);
        setCommonTitle("购买记录");

        for (int i = 0; i < 3; i++) {
            mRecordList.add(new BuyRecordEntity());
        }
        mRecordAdater = new BuyRecordAdapter(mRecordList);
        mRvBuyRecord.setLayoutManager(new LinearLayoutManager(getActivity()));
        mRvBuyRecord.setAdapter(mRecordAdater);
    }

    @OnClick(R.id.tv_empty_home)
    public void onViewClicked() {
    }
}
